<script >
export default {
    data() {
        return {
            a:'',
            selected: null,
            oldSe: null,
            list: [
                { id: '1' },
                { id: '2' },
                { id: '3' },
                { id: '4' },
            ],
            lists:[
                {name:'5'},
                {name:'6'},
                {name:'7'},
                {name:'8'},
            ]
        }
    }, methods: {
        gen() {
            this.selected = this.oldSe
        }
    }
}
</script>

<template>
    <div>
        <input type="text" name="select" id="" v-model="oldSe">
        <input type="button" value="点击" @click="gen">
        <div v-for="item in list" :key="item.id" v-memo="[item.id === this.selected]">
            <p>id:{{ item.id }}-selected:{{ item.id === this.selected }}</p>
        </div>
    </div>
    <div>
        <input type="button" value="点击" @click="a='6'">
        <div v-for="item in lists" :key="item.name" v-memo="[item.name === a]">
            <p>id:{{ item.name }}-selected:{{ item.name === a }}</p>
        </div>
    </div>
</template>

<style scoped></style>
